package cn.xz.tipsum.adapter

import android.content.res.ColorStateList
import android.widget.TextView
import androidx.core.graphics.toColorInt
import cn.xz.tipsum.R
import cn.xz.tipsum.bean.ErrorBean
import com.chad.library.adapter.base.BaseQuickAdapter
import com.chad.library.adapter.base.viewholder.BaseViewHolder

/**
 * 错误列表适配器*/
class ErrorListAdapter : BaseQuickAdapter<ErrorBean, BaseViewHolder>(R.layout.item_error_list) {

    override fun convert(holder: BaseViewHolder, item: ErrorBean) {
        val tvTxt = holder.getView<TextView>(R.id.tv_txt)
        tvTxt.text = item.title
        tvTxt.setTextColor(item.color!!.toColorInt())
    }
}